import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooWechatMenusController } from '../../../controllers';
const uctoowechatMenusRouter = new Router();
const wechatMenusController = new uctooWechatMenusController();

uctoowechatMenusRouter.post('/add', requireUser, wechatMenusController.add);
uctoowechatMenusRouter.post('/edit', requireUser, rowLevelPermission('uctoo/wechat_menus'), wechatMenusController.edit);
uctoowechatMenusRouter.post('/del', requireUser, rowLevelPermission('uctoo/wechat_menus'), wechatMenusController.delete);

//For getting wechatMenus with permission control
uctoowechatMenusRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/wechat_menus'), wechatMenusController.getSingle);
uctoowechatMenusRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/wechat_menus'), wechatMenusController.getMany);
uctoowechatMenusRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/wechat_menus'), wechatMenusController.getMany);

//#endregion AutoCreateCode
uctoowechatMenusRouter.get('/setMenus',  wechatMenusController.setMenus);
uctoowechatMenusRouter.get('/wechatopenSetMenus',  wechatMenusController.wechatopenSetMenus);
export default uctoowechatMenusRouter;
